Xbasic

A5_MENU_DEF_LOAD Function

Syntax

Menu_String as C = a5_menu_def_load(C menuname [,C context ])

Arguments

Menu_String

The menu data structured for display.

menuname

The name of a previous created menu.

context

Character

Description

The A5_MENU_DEF_LOAD() function reads a menu definition into a character string, which subsequently is displayed.

Example

The following pieces of code are from the MDI Xdialog Framework Xdialog lesson.

dim event_string as C
dim menu_string as C
event_string = <<%code%
if left(a_command,3) = "A5." then
    a5.command(substr(a_command,4) )
    a_command = ""
else if left(a_command,1) = "!" then
    evaluate_template(substr(a_command,2) )
    a_command = ""
else if left(a_command,6) = "addin:" then
    evaluate_template(substr(a_command,7) )
else if left(a_command,8) = "command:" then
    ui_dlg_event(dlg_title,substr(a_command,9) )
else if .not. ("|" $ a_command) then
    this.command(a_command)
    a_command = ""
end if
%code%
menu_string = a5_menu_def_load("MDI_test")
if a_dlg_button = "activate" then 'show the menu
    ui_top_menu(ui_expand_branches(menu_string), event_string)
end if

Limitations

Desktop applications only.

See Also